import request from '@/utils/request'

export function listRecord(nextPage, pageSize, sortData) {
  return request({
    url: '/usercenter/sys/user/list',
    method: 'post',
    params: { nextPage: nextPage, pageSize: pageSize, sortData: sortData }
  })
}

export function detailRecord(id) {
  return request({
    url: '/usercenter/sys/user/detail',
    method: 'post',
    params: { id: id }
  })
}

export function updateRecord(data) {
  return request({
    url: '/usercenter/sys/user/update',
    method: 'post',
    data
  })
}

export function operateSysUserByIdRecord(id, operateId, locked) {
  return request({
    url: '/usercenter/sys/user/operateSysUserById',
    method: 'post',
    params: { id: id, operateId: operateId, locked: locked }
  })
}

export function weChatBindingByIdRecord(id, operateId, weChatBinding) {
  return request({
    url: '/usercenter/sys/user/weChatBindingById',
    method: 'post',
    params: { id: id, operateId: operateId, weChatBinding: weChatBinding }
  })
}

export function safeLevelRecord(id) {
  return request({
    url: `/usercenter/sys/user/safeLevel/${id}`,
    method: 'get'
  })
}

export function unbindWechatRecord(id, operateId, weChatBinding) {
  return request({
    url: `/usercenter/sys/user/unbindWechat/${id}`,
    method: 'post',
    params: { id: id, operateId: operateId, weChatBinding: weChatBinding }
  })
}

